//
//  SEGIntergralCashCell.m
//  ExcellentHome
//
//  Created by 刘山 on 2017/2/17.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGIntergralCashCell.h"

#if __has_include(<Commom/SEGColorManager.h>)
#import <Commom/SEGColorManager.h>
#else
#import "SEGColorManager.h"
#endif

#if __has_include(<Commom/SEGLayoutMacro.h>)
#import <Commom/SEGLayoutMacro.h>
#else
#import "SEGLayoutMacro.h"
#endif

#if __has_include(<Commom/YYBaseHeader.h>)
#import <Commom/YYBaseHeader.h>
#else
#import "YYBaseHeader.h"
#endif

#if __has_include(<Commom/SEGBussinessConstHeader.h>)
#import <Commom/SEGBussinessConstHeader.h>
#else
#import "SEGBussinessConstHeader.h"
#endif

@implementation SEGIntergralCashCell

+(instancetype)cellWithTableView:(UITableView*)tableView WithIdentifier:(NSString*)Identifier{
    SEGIntergralCashCell *cell = [tableView dequeueReusableCellWithIdentifier:Identifier];
    if (!cell) {
        cell = [[NSBundle mainBundle] loadNibNamed:@"SEGIntergralCashCell" owner:nil options:nil].firstObject;;
        cell.iconImageView.layer.cornerRadius = 14;
        cell.iconImageView.layer.masksToBounds = YES;
        
    }
    [cell.cashLabel setTextColor:kColor_1];
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
       // [self setupUI];
    }
    return self;
}

-(void)setupUI{
    self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kLayout_15, kLayout_15, 28, 28)];
    [self.contentView addSubview:self.iconImageView];
    
    self.cashLabel = [UILabel labelWithFrame:CGRectMake(CGRectGetMaxX(self.iconImageView.frame) + 15, kLayout_15, 1, 1) WithFont:kFont_18 WithTag:1001 WithTextColor:kColor_1 WithTextAlignment:NSTextAlignmentLeft WithText:@"+00.00"];
    [self.cashLabel sizeToFit];
    [self.contentView addSubview:self.cashLabel];
    
    self.titleLabel = [UILabel labelWithFrame:CGRectMake(CGRectGetMaxX(self.iconImageView.frame) + 15, CGRectGetMaxY(self.cashLabel.frame) + 15, 0, 0) WithFont:kFont_13 WithTag:1002 WithTextColor:kColor_3 WithTextAlignment:NSTextAlignmentLeft WithText:@"来自"];
    [self.titleLabel sizeToFit];
    [self.contentView addSubview:self.titleLabel];
    
    self.timeLabel = [UILabel labelWithFrame:CGRectMake(0, 0, 0, 0) WithFont:kFont_13 WithTag:1003 WithTextColor:kColor_3 WithTextAlignment:NSTextAlignmentLeft WithText:@"0000-00-00 00:00"];
    CGSize timeSize = [self.timeLabel.text boundingRectWithContentWidth:LYScreenWidth() WithFontOfSize:13];
    self.timeLabel.frame = CGRectMake(CGRectGetWidth(self.contentView.frame) - timeSize.width - 15, CGRectGetMinY(self.titleLabel.frame), timeSize.width, timeSize.height);
    [self.contentView addSubview:self.timeLabel];
}

- (void)dealloc {
}
@end
